<!DOCTYPE html>
<html>
  <head>
    <title>GPS Simulator</title>
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
    <style>
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
      #map {
        height: 100%;
      }
    </style>
</head>
  <body>
  <ul id='messages'></ul>
  <div id="map"></div>
    <script src='/socket.io/socket.io.js'></script>
    <script>
      var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: 32.17503, lng: 34.90118},
          zoom: 17
        });
        var socket = io();
	google.maps.event.addListener(map, 'click', function(event) {
	    socket.emit('setPosition', event.latLng);
	    /* new google.maps.InfoWindow({
	      position: event.latLng,
	      content: event.latLng.toString() 
	    }).open(map);
	    */
	});
    }
    </script>
    <script src="https://maps.googleapis.com/maps/api/js?callback=initMap" async defer></script>
  </body>
</html>
